1. Field of the Invention
The invention relates to flash memories, and more particularly to a data trimming method for flash memories.
2. Description of the Related Art
A flash memory is used in an electronic apparatus for data storage. The flash memory comprises a plurality of blocks for data storage. Because a flash memory can keep the data stored therein without power supply, and a portable electronic device has limited power, the flash memory is suitable for data storage for the portable electronic device.
Each block of a flash memory comprises a plurality of pages, and a controller manages the flash memory according to a unit of a page. Each page of the flash memory comprises a plurality of data trimming units, and the controller modifies data stored in the flash memory according to a unit of a data trimming unit. Referring to FIG. 1, a schematic diagram of a block 100 of a flash memory according to the invention is shown. The block 100 comprises a plurality of pages 101˜10X, and each page comprises a plurality of data trimming units. For example, the third page 103 comprises data trimming units LBAi, LBAj, LBAk, . . . , and LBAm. In one embodiment, each page can store a data amount of 16 KB, and each data trimming unit can store a data amount of 512 KB. Thus, each page comprises 32 data trimming units.
When the controller directs the flash memory to perform a data trimming operation on an address range, the controller repeatedly writes a data bit 0 to the address range. After pages corresponding to the address range is written with the data bit 0, the controller must mark the pages as data trimmed pages for subsequent data management. A data storage device capable of marking the data trimmed pages from the flash memory is therefore required.